package cn.anquing.datastructure.sort;

import cn.anquing.datastructure.search.BinarySearch;
import cn.anquing.datastructure.util.SortTestHelper;

import java.util.Arrays;
import java.util.Comparator;

/**
 * 冒泡测试
 * @author wangquanqing
 * @since 2021/3/24 14:34
 */
public class Main {

    public static void main(String[] args) {

        BubbleSorter bubbleSorter = new BubbleSorter();
        Integer[] list0 = SortTestHelper.generateRandomArray(50, 10, 100);
        bubbleSorter.sortInt(list0);
        System.out.println(Arrays.asList(list0));

        Integer[] list1 = {1,2,3,4,8,7,6};
        bubbleSorter.sort(list1);
        System.out.println(Arrays.asList(list1));

        Integer[] list2 = {1,2,3,4,8,7,6};
        bubbleSorter.sort(list2, Comparator.comparing(Integer::intValue));
        System.out.println(Arrays.asList(list2));

    }

}
